<template>
	<view class="search">
		<swiper indicator-dots :circular="true" :autoplay="true" interval="3000" @click="tofenlei()">
			<swiper-item v-for="item in lun" :key="item.id">
				<image :src="'http://124.93.196.45:10001'+item.imgUrl" style="width: 100%;"></image>
			</swiper-item>
		</swiper>
		<view class="s1">
			<u-search @custom="tosearch()" @search="tosearch"></u-search>
			<view class="s2">
				<text>热门搜索</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				lun:[]
			}
		},
		onLoad() {
			this.getlunbo()
		},
		methods: {
			getlunbo(){
				this.api.get('/prod-api/api/garbage-classification/poster/list').then(res=>{
					this.lun=res.data.data
				})
			},
			tofenlei(){
				uni.navigateTo({
					url:'/pages/serve/laji/lajifenlei/lajifenlei'
				})
			},
			tosearch(){
				uni.navigateTo({
					url:'/pages/serve/laji/lajisoushuo/lajidetail/lajidetail'
				})
			}
		}
	}
</script>

<style lang="scss">
	.s2{
		display: none;
		text{
			margin-left: 10px;
			font-size: 20px;
		}
	}
.s1:hover{
	.s2{
		display: block;
		width: 250px;
		height: 100px;
		background-color: #ccc;
		position: absolute;
		border-radius: 15px;
	}
}
</style>
